package net.tv90.bfmccore.listener.effect;

import lombok.AllArgsConstructor;
import lombok.Data;
import net.tv90.bfmccore.helper.FactionHelper;
import net.tv90.bfmccore.helper.MCHHelper;
import org.bukkit.entity.Player;


@Data
@AllArgsConstructor
public abstract class RadioEffect {
    String sound;
    String name;

    public void playEffectForPlayer(Player p, String country) {
        p.playSound(p.getLocation(), "faction." + country + "_" + sound, 100.0F, 1.0F);
        p.sendMessage("§a[队伍] " + p.getName() + " >>> " + name);
    }

    public void playEffectForTeamExcludeSelf(Player p, Player teamer, String country, String soundFilterType) {
        teamer.playSound(teamer.getLocation(), "filter." + soundFilterType + "_FILTER", 100.0F, 1.0F);
        teamer.playSound(teamer.getLocation(), "faction." + country + "_" + sound, 100.0F, 1.0F);
        if(FactionHelper.isInSameWorld(p, teamer)) {
            teamer.sendMessage("§a[队伍] " + p.getName() + "(" + MCHHelper.getMCHEntitiesType_Lang(p) + ", " +
                    (int) teamer.getLocation().distance(p.getLocation()) + "m) >>> " + name);
        }
    }

    public void playEffectForTeam(Player p, Player teamer) {

    }


}